Wall.Create
Description:
Creates a non rectangular profile wall within the project using the specified wall type and normal vector.
Creates a non rectangular profile wall within the project using the specified wall type and normal vector.
Overloads (5):
Create(Document,IList[Curve],ElementId,ElementId,Boolean,XYZ)
-
documentThe document in which the new wall is created.
-
IList<Curve>profileAn array of planar curves that represent the vertical profile of the wall.
-
wallTypeIdId of the wall type to be used by the new wall instead of the default type.
-
levelIdId of the level on which the wall is to be placed.
-
BooleanstructuralIf set, specifies that the wall is structural in nature.
-
normalA vector that must be perpendicular to the profile which dictates which side of the wall is considered to be inside and outside.
public Wall CreateWallUsingProfile(Autodesk.Revit.DB.Document document, Level level, WallType wallType)
{
// Build a wall profile for the wall creation
XYZ first = new XYZ(0, 0, 0);
XYZ second = new XYZ(20, 0, 0);
XYZ third = new XYZ(20, 0, 15);
XYZ fourth = new XYZ(0, 0, 15);
IList<Curve> profile = new List<Curve>();
// Get application creation object
Autodesk.Revit.Creation.Application appCreation = document.Application.Create;
profile.Add(Line.CreateBound(first, second));
profile.Add(Line.CreateBound(second, third));
profile.Add(Line.CreateBound(third, fourth));
profile.Add(Line.CreateBound(fourth, first));
XYZ normal = new XYZ(0, 1, 0);
// Create a wall
return Wall.Create(document, profile, wallType.Id, level.Id, true, normal);
}
-
The input profile contains at least one helical curve and is not supported for this operation.
-
A non-optional argument was null
-
Failed to create the wall.
-
The document is in failure mode: an operation has failed, and Revit requires the user to either cancel the operation or fix the problem (usually by deleting certain elements). -or- The document is being loaded, or is in the midst of another sensitive process.
-
The document has no open transaction.